package org.tong.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

/**
 * @author
 * @date 2022-08-09 18:01
 */
@Aspect
public class MyLogAspect {

    @Around("@annotation(org.tong.aspect.LogAspect)")
    public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable {
        System.out.println("1>>>>" + joinPoint.getSignature());
        return joinPoint.proceed(joinPoint.getArgs());
    }

    @Around("execution(* org.tong..*.index(..))")
    public Object log2(ProceedingJoinPoint joinPoint) throws Throwable {
        System.out.println("2>>>>" + joinPoint.getSignature());
        return joinPoint.proceed(joinPoint.getArgs());
    }
}
